<script setup lang="ts">
import ChannelNav from './components/ChannelNav.vue';
import ArticleList from './components/ArticleListV.vue'
import { useChannelStore } from './stores/channel';

const store = useChannelStore()

</script>
<template>
  <!-- 
    父传子 ： 通过 defineProps 和 v-bind:  传递数据
    子传父 ： 通过 defineEmits 和 v-on: 传递函数，调用函数回传数据
  -->
  <ChannelNav :channelId="store.channelId" @update:channelId="store.updateChannelId" />
  <ArticleList :channelId="store.channelId" />
  <!-- 路由视口 -->
  <router-view />
</template>